package com.wdhcr.service;

import com.wdhcr.entity.Blog;
import com.wdhcr.entity.Tag;
import com.wdhcr.entity.Type;
import com.wdhcr.utils.ResponseResult;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;

import java.util.List;

/*
 * @description: BLOG方法控制接口
 * @author: wdhcr
 * @dateTime: 2020/3/19 20:17
 */
public interface BlogService {

    Blog saveBlog(Blog blog);

    List<Blog> findAll();

    Page<Blog> findAll(Pageable pageable);

    Page<Blog> findPubAll(Pageable pageable);

    List<Blog> findPubTop(Integer size);

    Blog findById(Integer id);

    Page<Blog> findByQuery(Pageable pageable, String query);

    List<Blog> findByQueryPub(Sort sort, String query);

    Page<Blog> findBlogByType(Pageable pageable, Type type);

    Page<Blog> findBlogByTag(Pageable pageable, Tag tag);

    ResponseResult deleteById(Integer id);
}
